var xmlHttp = null;

	try {
		xmlHttp = new XMLHttpRequest();
	} catch (e) {
		// Internet Explorer
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		};
	}

	function ExeAct2(url) {
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState == 4) {
				var result = xmlHttp.responseText;
				if (result != '') {
					if(result == 'FolderIsNotNull'){
						alert("文件夹不为空，删除失败");
					}else{
						var table1 = document.getElementById("table1");
						table1.innerHTML = result;
					};
				};
			};
		};
		xmlHttp.open("post", url, false);
		xmlHttp.send(null);
	}

	function testTry(param1, param2, param3, param4) {
		var url = "";
		param1 = param1.replace(/\-/g,"~");//把文件名中才-替换成~，否则传输时报错
		param1 = param1.replace(/\_/g,"@");//把文件名中才_替换成@，否则传输时报错
		param1 = param1.replace(/\./g,"!");//把文件名中才.替换成!，否则传输时报错
		if (param3 == '2')
			url = "czp/fileIn/" + encodeURIComponent(param1) + "-" + encodeURIComponent(param2);
		else if (param3 == '1')
			url = "czp/fileInfo/" + encodeURIComponent(param1) + "-" + encodeURIComponent(param2);
		ExeAct2(param4+url);
	}

	function deleteFile(param1, param2, param3) {
		var msg = "您真的确定要删除吗？\n\n请确认！";
		if (confirm(msg) == true) {
			param1 = param1.replace(/\./g,"!");//把文件名中才.替换成!，否则传输时报错
			param1 = param1.replace(/\_/g,"@");//把文件名中才_替换成@，否则传输时报错
			param1 = param1.replace(/\-/g,"~");//把文件名中才-替换成~，否则传输时报错
			var url = "czp/deleteFile/" + encodeURIComponent(param1) + "-" + encodeURIComponent(param2);
			ExeAct2(param3+url);
		} else {
			return false;
		};
	}
	
	function createFolder(param1, param2){
		var name = prompt("请输入文件夹名称:", "新建文件夹");
		if(name){
			if(name.indexOf("~") >= 0 || name.indexOf("@") >= 0 || name.indexOf("!") >= 0 || name.indexOf("\\") >= 0 || name.indexOf("/") >= 0 || name.indexOf("'") >= 0  || name.indexOf("|") >= 0)
				alert("文件夹名称包含 ~ @ ! \\ / ' | 等非法字符");
			else{
				name = name.replace(/\-/g,"~");//把文件名中才-替换成~，否则传输时报错
				name = name.replace(/\_/g,"@");//把文件名中才_替换成@，否则传输时报错
				name = name.replace(/\./g,"!");//把文件名中才.替换成!，否则传输时报错
				var url = "czp/createFolder/" + encodeURIComponent(param1) + "-" + encodeURIComponent(name);
				ExeAct2(param2+url);
			}
		}
	}
	
	function upFolder(param1,param2){
		var url = "czp/parentFolder/"+encodeURIComponent(param1);
		ExeAct2(param2+url);
	}
	
	function upload(param1,param2){
		var url = "czp/uploadFile/"+encodeURIComponent(param1);
		window.open(param2+url);
	}